package com.hb.unic.core.base.enums;

import java.util.ArrayList;
import java.util.List;

import com.hb.unic.core.base.DropdownVO;
import com.hb.unic.core.base.IDropdown;

import lombok.Getter;

/**
 * 是否删除枚举
 *
 * @since v1.0，2023/8/25 21:51，create by Mr.Huang.
 */
@Getter
public enum IsDeleteEnum implements IDropdown<Integer> {

    DELETE(0, "已删除"), NOT_DELETE(1, "未删除");

    /**
     * 值
     */
    private final int value;

    /**
     * 名称
     */
    private final String name;

    IsDeleteEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    /**
     * 是否删除
     *
     * @param val 值
     * @return 结果
     */
    public static boolean isDelete(int val) {
        return DELETE.value == val;
    }

    @Override
    public List<DropdownVO<Integer>> getDropdownDatas() {
        List<DropdownVO<Integer>> dropdownDataList = new ArrayList<>();
        for (IsDeleteEnum isDeleteEnum : IsDeleteEnum.values()) {
            dropdownDataList.add(new DropdownVO<>(isDeleteEnum.value, isDeleteEnum.name));
        }
        return dropdownDataList;
    }
}
